﻿<Window x:Class="DBLoader.ConnectionChooser"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Connect to SilverMap database" Height="300" Width="300">


	<Window.Resources>
		<DataTemplate x:Key="listBoxTemplate">
			<StackPanel Orientation="Horizontal">
				<TextBlock Text="{Binding Name}" />
				<TextBlock Text="(" Margin="3 0 0 0" />
				<TextBlock Text="{Binding GenomeCount}"/>
				<TextBlock Text=" genomes)" />
			</StackPanel>
		</DataTemplate>
	</Window.Resources>


	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="*" />
			<RowDefinition Height="3" />
			<RowDefinition Height="auto" />
		</Grid.RowDefinitions>
		
		<ListBox Grid.Row="0" Name="databaseList" ItemTemplate="{StaticResource listBoxTemplate}" SelectionChanged="databaseListSelectionChanged"/>
		
		<Grid Grid.Row="2">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="*" />
				<ColumnDefinition Width="10" />
				<ColumnDefinition Width="*" />
			</Grid.ColumnDefinitions>
			
			<Button Width="50" Content="Ok" HorizontalAlignment="Right"
					Click="Ok" />

			<Button Width="50" Content="Cancel" HorizontalAlignment="Left"
					Click="Cancel" Grid.Column="3"/>
		</Grid>
	</Grid>
</Window>
